|
stepper27 2.2.1
|
API for configuring and manipulating Stepper 27 Click driver. More...
Topics | |
| Stepper 27 Settings | |
| Settings of Stepper 27 Click driver. | |
| Stepper 27 MikroBUS Map | |
| MikroBUS pin mapping of Stepper 27 Click driver. | |
Functions | |
| void | stepper27_cfg_setup (stepper27_cfg_t *cfg) |
| Stepper 27 configuration object setup function. | |
| err_t | stepper27_init (stepper27_t *ctx, stepper27_cfg_t *cfg) |
| Stepper 27 initialization function. | |
| void | stepper27_enable_device (stepper27_t *ctx) |
| Stepper 27 enable device function. | |
| void | stepper27_disable_device (stepper27_t *ctx) |
| Stepper 27 disable device function. | |
| void | stepper27_set_direction (stepper27_t *ctx, uint8_t dir) |
| Stepper 27 set direction function. | |
| void | stepper27_switch_direction (stepper27_t *ctx) |
| Stepper 27 switch direction function. | |
| void | stepper27_set_sleep_pin (stepper27_t *ctx, uint8_t state) |
| Stepper 27 set sleep pin function. | |
| void | stepper27_reset_device (stepper27_t *ctx) |
| Stepper 27 reset device function. | |
| void | stepper27_set_step_pin (stepper27_t *ctx, uint8_t state) |
| Stepper 27 set step pin function. | |
| uint8_t | stepper27_get_fault_pin (stepper27_t *ctx) |
| Stepper 27 get fault pin function. | |
| void | stepper27_drive_motor (stepper27_t *ctx, uint32_t steps, uint8_t speed) |
| Stepper 27 driver motor function. | |
API for configuring and manipulating Stepper 27 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void stepper27_cfg_setup | ( | stepper27_cfg_t * | cfg | ) |
Stepper 27 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See stepper27_cfg_t object definition for detailed explanation. |
| void stepper27_disable_device | ( | stepper27_t * | ctx | ) |
Stepper 27 disable device function.
This function disables the device output by setting the EN pin to low logic state.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| void stepper27_drive_motor | ( | stepper27_t * | ctx, |
| uint32_t | steps, | ||
| uint8_t | speed ) |
Stepper 27 driver motor function.
This function drives the motor for the specific number of steps at the selected speed.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| [in] | steps | : Number of steps to rotate motor. |
| [in] | speed | : Motor rotation speed:
|
| void stepper27_enable_device | ( | stepper27_t * | ctx | ) |
Stepper 27 enable device function.
This function enables the device output by setting the EN pin to high logic state.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| uint8_t stepper27_get_fault_pin | ( | stepper27_t * | ctx | ) |
Stepper 27 get fault pin function.
This function returns the FAULT pin logic state.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| err_t stepper27_init | ( | stepper27_t * | ctx, |
| stepper27_cfg_t * | cfg ) |
Stepper 27 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See stepper27_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void stepper27_reset_device | ( | stepper27_t * | ctx | ) |
Stepper 27 reset device function.
This function resets the device by toggling the SLEEP pin logic state.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| void stepper27_set_direction | ( | stepper27_t * | ctx, |
| uint8_t | dir ) |
Stepper 27 set direction function.
This function sets the motor direction by setting the DIR pin logic state.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| [in] | dir | :
|
| void stepper27_set_sleep_pin | ( | stepper27_t * | ctx, |
| uint8_t | state ) |
Stepper 27 set sleep pin function.
This function sets the SLEEP pin logic state.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| [in] | state | :
|
| void stepper27_set_step_pin | ( | stepper27_t * | ctx, |
| uint8_t | state ) |
Stepper 27 set step pin function.
This function sets the STEP pin logic state.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |
| [in] | state | :
|
| void stepper27_switch_direction | ( | stepper27_t * | ctx | ) |
Stepper 27 switch direction function.
This function switches the motor direction by toggling the DIR pin.
| [in] | ctx | : Click context object. See stepper27_t object definition for detailed explanation. |